﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Optimization;
using System.Web.Mvc;

namespace WebUI.Helpers {
    public static class HtmlHelpers {
        public static IHtmlString ViewScript(this HtmlHelper helper, string viewName) {
            var controller = HttpContext.Current.Request.RequestContext.RouteData.Values["controller"].ToString();
            var action = HttpContext.Current.Request.RequestContext.RouteData.Values["action"].ToString();


            return Scripts.Render(string.Format("~/ViewScripts/{0}/{1}.js", controller, action));
        }

        public static IHtmlString ViewStyle(this HtmlHelper helper, string viewName) {
            var controller = HttpContext.Current.Request.RequestContext.RouteData.Values["controller"].ToString();
            var action = HttpContext.Current.Request.RequestContext.RouteData.Values["action"].ToString();


            return Styles.Render(string.Format("~/ViewStyles/{0}/{1}.css", controller, action));
        }
    }
}